package cu.tedu.egmvc4.controller;

import cu.tedu.egmvc4.mapper.CustomersMapper;
import cu.tedu.egmvc4.pojo.entity.Customers;
import cu.tedu.egmvc4.pojo.vo.CustomersVO2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/cust/")
public class CustomersController {
    @Autowired
    private CustomersMapper customersMapper;


    @RequestMapping("insert")
    public String insert(Customers customers){
        return "添加成功"+customersMapper.insert(customers);
    }

    @RequestMapping("select")
    public List<CustomersVO2> select(String address){
        return customersMapper.select(address);
    }

    @RequestMapping("update")
    public String update(Customers customers){


        return "修改成功"+customersMapper.update(customers);
    }
}
